#pragma once
#include <stdio.h>
#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>
typedef int HeapDataType;
typedef struct Heap
{
	HeapDataType* a;
	int size;
	int capacity;
}Heap;

void HeapInit(Heap* php);
void HeapDestroy(Heap* php);
void HeapPush(Heap* php,HeapDataType x);
void HeapPop(Heap* php);
bool HeapEmpty(Heap* php);
int HeapSize(Heap* php);
HeapDataType HeapTop(Heap* php);

void Swap(HeapDataType* p1, HeapDataType* p2);
void AdjustUp(HeapDataType* a, int child);
void AdjustDown(HeapDataType* a, int size, int parent);